From 48dbdd77c80b9ffd602b539a50667619d8083600 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 25 May 2003 00:11:24 +0000 Subject: [PATCH] Use proper escaping for title-URLs; also support namespaces; also support recentchagnes table --- includes/SpecialAsksql.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/includes/SpecialAsksql.php b/includes/SpecialAsksql.php index edddd06297..34403c389c 100644 --- a/includes/SpecialAsksql.php +++ b/includes/SpecialAsksql.php @@ -54,7 +54,7 @@ class SqlQueryForm { function doSubmit() { - global $wgOut, $wgUser, $wgServer, $wgScript, $wgArticlePath; + global $wgOut, $wgUser, $wgServer, $wgScript, $wgArticlePath, $wgLang; global $wpSqlQuery; global $wgDBsqluser, $wgDBsqlpassword; @@ -91,9 +91,13 @@ class SqlQueryForm { $r .= ""; foreach ( $k as $x ) { $o = $y->$x ; - if ( $x == "cur_title" or $x == "old_title" ) { - $o = str_replace ( "$1" , rawurlencode( $o ) , $wgArticlePath ) ; - $o = "" . + if ( $x == "cur_title" or $x == "old_title" or $x == "rc_title") { + $namespace = 0; + if( $x == "cur_title" ) $namespace = $y->cur_namespace; + if( $x == "old_title" ) $namespace = $y->old_namespace; + if( $x == "rc_title" ) $namespace = $y->rc_namespace; + if( $namespace ) $o = $wgLang->getNsText( $namespace ) . ":" . $o; + $o = "" . htmlspecialchars( $y->$x ) . "" ; } else { $o = htmlspecialchars( $o ); -- 2.20.1